<form id="${id}" name="${id}" method="post" class="eova-form" >
<%
		// 获取分组元字段数据
		var fields = query("form_field", code);

		for(f in fields){
			if(f.type != "单选框" && f.type != "复选框" && f.type != "下拉框" && f.type != "数字框") continue;
%>
			<div class="eova-form-field">
				<label class="eova-form-label">${f.cn}</label>
				<%if(f.type == "单选框" || f.type == "复选框" || f.type == "下拉框"){%>
					<#combo id="${f.en}" name="${f.en}" exp="${f.exp}" multiple="true"/>
					<%if(!isEmpty(f.items_json!)){ %>
					<script>
					$(function(){
						var $type = $('#${f.en}').eovacombo({
							json : ${f.items_json}
						}).reload();
					});
					</script>
					<%} %>
				<%}else if(f.type == "数字框"){%>
					<#num id="${f.en}" name="${f.en}" />
				<%}%>
			</div>
<%      
		}
%>
</form>
<script>
$(function(){
    var $form = $('#${id}');
    $form.validator({
        debug: false,
        stopOnError: true,
        focusInvalid : true,
        showOk: false,
        timely: 0,
        msgMaker: false,
        fields: {
	        <%for(f in fields){%>
	        	<%if((f.add_status == 0 || f.update_status == 0) && (isTrue(f.is_required) || !isEmpty(f.validator))){%>
	                ${f.en} : { rule: "${isTrue(f.is_required)?f.cn + ':required;' : ''}${f.validator!}" },
	            <%}%>
	        <%}%>
        }
    });
    $form.on("validation", $.validation);
});
</script>